<script type="text/javascript">
    // increase the default animation speed to exaggerate the effect
           
    $(document).ready(function() {	
        
         
        var r= $('#tabla').dataTable({
            "sPaginationType": "full_numbers"        
                       
        });
        
        
    });
    
    
</script>


<h1>CONTRATOS PERTENECIENTES A <?php echo strtoupper($user_nombre); ?></h1>
<div>
    <table id="tabla" class="tabla" width="100%">
        <thead>
            <tr>
                <th>Numero</th>
                <th>Fecha de inicio</th>
                <th>Fecha finalización </th>            
                <th></th>
                <th></th>
                <th></th>
                <th></th>
            </tr>
        </thead>

        <tbody>
            <?php foreach ($contratos as $contrato): ?>
                <tr>
                    <td><?php echo $contrato['Contract']['numero'] ?></td>
                    <td><?php echo $contrato['Contract']['fecha_inicio'] ?></td>
                    <td><?php echo $contrato['Contract']['fecha_final'] ?></td>
                    <td><?php echo $this->Ajax->link('Ver', array('controller' => 'Contracts', 'action' => 'view', $contrato['Contract']['id']), array('update' => 'content', 'indicator' => 'loading','class'=>'table_link')) ?></td>
                    <td><?php echo $this->Ajax->link('Editar', array('controller' => 'Contracts', 'action' => 'edit', $contrato['Contract']['id']), array('update' => 'content', 'indicator' => 'loading','class'=>'table_link')) ?></td>
                    <td><?php echo $this->Ajax->link('Obligaciones', array('controller' => 'Obligations', 'action' => 'index', $contrato['Contract']['id']), array('update' => 'content', 'indicator' => 'loading','class'=>'table_link')) ?></td>
                    <td><?php echo $this->Ajax->link('Cuentas de cobro', array('controller' => 'Accounts', 'action' => 'index', $contrato['Contract']['id']), array('update' => 'content', 'indicator' => 'loading','class'=>'table_link')) ?></td>
                <?php endforeach; ?>
        </tbody>
    </table>
</div>
<p><?php echo $this->Ajax->link('Añadir contrato ' . $this->Html->image("add.png", array('width' => '30', 'heigth' => '30', 'alt' => 'Adicionar proyecto')), array('controller' => "Contracts", "action" => "add", $user_id), array('update' => 'content', 'indicator' => 'loading', 'escape' => false)) ?></p>


<br><br><br>
